package com.ruoyi.system.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.service.IStudioAttentionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/attention")
public class attentionController {
    @Autowired
    private IStudioAttentionService studioAttentionService;

    /**
     * 获取直播间id
     * author：戴泽杨
     */
    @RequestMapping(path ="/userFollow",method = RequestMethod.POST)
    @ResponseBody
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public AjaxResult getStudioAttention(HttpServletRequest request){
        String userid = request.getParameter("userid");
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.put("code","200");
        ajaxResult.put("msg","成功");
        ajaxResult.put("data",studioAttentionService.getstudioid(userid));
        return ajaxResult;
    }
}
